<Gui:ViewControl x:Class="DanielVaughan.Calcium.Modules.ModuleManager.ModuleManagerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Gui="clr-namespace:DanielVaughan.Calcium.Gui"
    xmlns:Module="clr-namespace:DanielVaughan.Calcium.Modules.ModuleManager"	
	DataContext="{Binding ViewModel, RelativeSource={RelativeSource Self}}">
	<Gui:ViewControl.ViewModel>
		<Module:ModuleManagerViewModel />
	</Gui:ViewControl.ViewModel>
	<DockPanel x:Name="ContentPanel">
		<DockPanel.Resources>
			<DataTemplate x:Key="checkBoxTemplate">
				<Border>
					<CheckBox IsChecked="{Binding Path=Enabled, Mode=TwoWay}" 
							  IsEnabled="{Binding Path=UserCanEnable, Mode=OneWay}" />
				</Border>
			</DataTemplate>
		</DockPanel.Resources>
		<ListView HorizontalContentAlignment="Stretch" ItemsSource="{Binding ApplicationModules}">
			<ListView.View>
				<GridView>					
					<GridViewColumn CellTemplate="{DynamicResource checkBoxTemplate}" Header="Enabled"/>
					<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=ModuleName}" Width="120"/>
					<GridViewColumn Header="State" DisplayMemberBinding="{Binding Path=State}" />
				</GridView>
			</ListView.View>
		</ListView>
	</DockPanel>
</Gui:ViewControl>
